package com.ynwa.dp.singleton;

/**
 * @author gzd
 * @date 2018-10-22 下午 5:48
 * @desc 懒加载
 */
public class Lazy {

    public static String a = "222";

    private Lazy(){
        System.out.println("初始化了 ...");
    }

    private static Lazy lazy = null;

    public static synchronized Lazy getInstance(){
        if (lazy == null){
            return new Lazy();
        }
        return lazy;
    }
}
